home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / OLE2BOOK.ZIP / CHAP06.ZIP / CHAP06 / COSCHMOO / CLIENT.CPP < prev    next >
C/C++ Source or Header  |  1993-03-27  |  2KB  |  98 lines

  1. /*
  2.  * CLIENT.CPP
  3.  * Component Schmoo Chapter 6
  4.  *
  5.  * Implementation of the CSchmooClient class that just makes sure
  6.  * we get a CSchmooDoc on doc creation and that we initialize fully.
  7.  *
  8.  * Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  9.  *
  10.  * Kraig Brockschmidt, Software Design Engineer
  11.  * Microsoft Systems Developer Relations
  12.  *
  13.  * Internet  :  kraigb@microsoft.com
  14.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  15.  */
  16.  
  17.  
  18.  
  19. #include "coschmoo.h"
  20.  
  21.  
  22. /*
  23.  * CSchmooClient::CSchmooClient
  24.  * CSchmooClient::~CSchmooClient
  25.  *
  26.  * Constructor Parameters:
  27.  *  hInst           HINSTANCE of the application.
  28.  */
  29.  
  30. CSchmooClient::CSchmooClient(HINSTANCE hInst)
  31.     : CClient(hInst)
  32.     {
  33.     return;
  34.     }
  35.  
  36.  
  37. CSchmooClient::~CSchmooClient(void)
  38.     {
  39.     return;
  40.     }
  41.  
  42.  
  43.  
  44.  
  45.  
  46. /*
  47.  * CSchmooClient::CreateCDocument
  48.  *
  49.  * Purpose:
  50.  *  Constructs a new document specific to the application.
  51.  *
  52.  * Parameters:
  53.  *  None
  54.  *
  55.  * Return Value:
  56.  *  LPCDocument     Pointer to the new document object.
  57.  */
  58.  
  59. LPCDocument CSchmooClient::CreateCDocument(void)
  60.     {
  61.     return (LPCDocument)(new CSchmooDoc(m_hInst));
  62.     }
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. /*
  71.  * CSchmooClient::NewDocument
  72.  *
  73.  * Purpose:
  74.  *  Small override of the CClient::NewDocument that we have just to
  75.  *  check the initial line selection on new document creation.
  76.  *
  77.  * Parameters:
  78.  *  fVisible        BOOL indicating if the document is to be visible or not.
  79.  *  pAdv            LPCDocumentAdviseSink to set with the new document for
  80.  *                  notifications.  Can be NULL.
  81.  *
  82.  * Return Value:
  83.  *  LPCDocument      Pointer to the new document object.
  84.  */
  85.  
  86. LPCDocument CSchmooClient::NewDocument(BOOL fVisible, LPCDocumentAdviseSink pAdv)
  87.     {
  88.     LPCDocument pDoc;
  89.  
  90.     //Perform default NewDocument first
  91.     pDoc=CClient::NewDocument(fVisible, pAdv);
  92.  
  93.     //We know that m_pFR is actually a CSchmooFrame, so the type is safe.
  94.     ((LPCSchmooFrame)m_pFR)->CheckLineSelection(IDM_LINESOLID);
  95.  
  96.     return pDoc;
  97.     }
  98.